﻿using Cirrious.MvvmCross.Commands;
using Conference.Core.BL.Entities;
using Conference.Core.UX.Models;
using System.Windows.Input;

namespace Conference.Core.UX.ViewModels
{
    public partial class SpeakerListEntityViewModel : ListEntityViewModel<SpeakerModel, SpeakerEntity, SpeakerReadEntityViewModel>
    {
        public override ICommand ItemSelectedCommand
        {
            get
            {
                return new MvxRelayCommand<SpeakerReadEntityViewModel>(
                    (e) => RequestNavigate<SpeakerReadEntityViewModel>(
                        new SpeakerModelParameters() { Id = e.Data.Id }
                        )
                    );
            }
        }

        public override ICommand AddCommand
        {
            get
            {
                return new MvxRelayCommand(OnAdd);
            }
        }

        private void OnAdd()
        {
            RequestNavigate<SpeakerCreateEntityViewModel>(new SpeakerModelParameters());
        }
    }
}